<template>
  <div class="page-footer">
    <ul class="footer-nav">
      <footer-item v-for="(item, index) in footerNavList" :key="index" :item="item"></footer-item>
    </ul>
  </div>
</template>

<script>
let FooterItem = {
  props: ['item'],
  template: `<li @click="handleLiClick(item.tag)">
              <i :class="item.classes" v-html="item.iconCode"></i>
              <div class="footer-nav-item">{{item.contents}}</div>
             </li>`,
  methods: {
    handleLiClick (tag) {
      console.log(tag)
      this.$router.push('' + tag)
    }
  }
}
export default {
  name: 'Footer',
  components: {
    FooterItem
  },
  data () {
    return {
      footerNavList: [{
        classes: 'iconfont footer-icon',
        iconCode: '&#xe60a;',
        tag: '/',
        contents: '首页'
      }, {
        classes: 'iconfont footer-icon',
        iconCode: '&#xe7f9;',
        tag: '/types',
        contents: '分类'
      }, {
        classes: 'iconfont footer-icon release',
        iconCode: '&#xe66f;',
        tag: '/release',
        contents: ''
      }, {
        classes: 'iconfont footer-icon',
        iconCode: '&#xe631;',
        tag: '/circles',
        contents: '圈子'
      }, {
        classes: 'iconfont footer-icon',
        iconCode: '&#xe629;',
        tag: '/mine',
        contents: '我的'
      }]
    }
  },
  methods: {
  }
}
</script>

<style>
  .page-footer{
    position: fixed;
    width: 100%;
    height: 48px;
    bottom: 16px;
  }
  .footer-nav{
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin-top: 15px;
  }
  .footer-nav > li{
    flex: auto;
    text-align: center;
    font-size: 10px;
  }
  .footer-icon{
    font-size: 25px;
    margin-top: 5px;
  }
  .release{
    font-size: 35px;
  }
  .footer-nav-item{
    margin-top: 3px;
  }
</style>
